<?php require('connections/con_gl.php'); ?>
<?php
cekAkses($_SESSION[akses],"DD-7-2");

mysql_select_db($database_con_gl, $con_gl);
$query_klas1 = "SELECT id, gudang FROM gl_gudang ORDER BY gudang ASC";
$klas1 = mysql_query($query_klas1, $con_gl) or die(mysql_error());
$row_klas1 = mysql_fetch_assoc($klas1);
$totalRows_klas1 = mysql_num_rows($klas1);

$colname_edit = "-1";
if (isset($_GET['id'])) {
  $colname_edit = (get_magic_quotes_gpc()) ? $_GET['id'] : addslashes($_GET['id']);
}
mysql_select_db($database_con_gl, $con_gl);
$query_edit = sprintf("SELECT * FROM gl_kontak WHERE id = %s", $colname_edit);
$edit = mysql_query($query_edit, $con_gl) or die(mysql_error());
$row_edit = mysql_fetch_assoc($edit);
$totalRows_edit = mysql_num_rows($edit);
?>

<html>
<head>
<link href="ccss/ui.datepicker.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="js/ui.datepicker.js"></script>
</head>
<body>
<div id="loading" style="display:none;"><img src="images/loading.gif" alt="loading..." /></div>
<div id="result" style="display:none;"></div>
<h1>View Data Customer Retail </h1>
<form action="proses/customerretail.php?act=edit" method="POST" name="edit" id="edit" >
  <table width="100%" border="0" align="center" cellpadding="5" cellspacing="0">
    <tr>
      <td align="right">&nbsp;</td>
      <td align="right" bgcolor="#DDDDDD"><div align="left">Biodata Customer </div></td>
      <td bgcolor="#DDDDDD">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#DDDDDD">Status Customer </td>
      <td bgcolor="#DDDDDD">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    <tr>
      <td align="right" bgcolor="#FFFFFF">&nbsp;</td>
      <td align="right" valign="top" bgcolor="#FFFFFF">TIPE CUSTOMER </td>
      <td valign="top" bgcolor="#FFFFFF"><?php echo $row_edit['tretail']; ?></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td width="18%" bgcolor="#FFFFFF"><div align="right">Tanggal Daftar : </div></td>
      <td width="24%" bgcolor="#FFFFFF"><?php echo $row_edit['tgldaftar']; ?></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    <tr>
      <td width="7%" align="right" bgcolor="#FFFFFF">&nbsp;</td>
      <td align="right" valign="top" bgcolor="#FFFFFF">Nama* : </td>
      <td valign="top" bgcolor="#FFFFFF"><label>
        <?php echo $row_edit['nama']; ?>
      </label></td>
      <td width="1%" bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="top" bgcolor="#FFFFFF"><div align="right">Daftar di Area : </div></td>
      <td valign="top" bgcolor="#FFFFFF"><input type="hidden" name="area" id="area" value="<?php echo $row_edit['area']; ?>" />
        <?php list($namaarea) = mysql_fetch_row(mysql_query("select area from gl_area where id = '$row_edit[area]'"));?>
        <?php echo $namaarea; ?>
      <td width="11%" bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    <tr valign="top">
      <td align="right" bgcolor="#FFFFFF">&nbsp;</td>
      <td align="right" bgcolor="#FFFFFF">Jenis Kelamin : </td>
      <td bgcolor="#FFFFFF"><?php echo $row_edit['jeniskelamin']; ?></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF"><div align="right">Daftar di Cabang: </div></td>
      <td bgcolor="#FFFFFF"><label id="divJenis">
        <input type="hidden" name="cabang" id="cabang" value="<?php echo $row_edit['cabang']; ?>" />
	  <?php list($namacabang) = mysql_fetch_row(mysql_query("select gudang from gl_gudang where id = '$row_edit[cabang]'"));?>
	  <?php echo $namacabang; ?>
        </label>          </td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    <tr valign="top">
      <td align="right" bgcolor="#FFFFFF">&nbsp;</td>
      <td align="right" bgcolor="#FFFFFF">Tempat &amp; Tanggal Lahir : </td>
      <td bgcolor="#FFFFFF"><?php echo $row_edit['tempatlahir']; ?>
          <?php echo $row_edit['tgllahir']; ?></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF"><div align="right">Status Customer : </div></td>
      <td bgcolor="#FFFFFF"><?php echo  $row_edit['status']; ?></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    <tr valign="top">
      <td align="right" bgcolor="#FFFFFF">&nbsp;</td>
      <td align="right" bgcolor="#FFFFFF">Alamat* : </td>
      <td rowspan="2" bgcolor="#FFFFFF"><?php echo $row_edit['alamat']; ?>
          <input name="id" type="hidden" id="id" value="<?php echo $row_edit['id']; ?>" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF"><div align="right">Keterangan : </div></td>
      <td rowspan="2" bgcolor="#FFFFFF"><?php echo $row_edit['keterangan']; ?>
          <input name="id3" type="hidden" id="id3" value="<?php echo $row_edit['id']; ?>" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    <tr valign="top">
      <td align="right" bgcolor="#FFFFFF">&nbsp;</td>
      <td align="right" bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    <tr valign="top">
      <td align="right" bgcolor="#FFFFFF">&nbsp;</td>
      <td align="right" bgcolor="#FFFFFF">Telp/HP* : </td>
      <td bgcolor="#FFFFFF"><?php echo $row_edit['tlp']; ?></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#DDDDDD">Data Referensi </td>
      <td bgcolor="#DDDDDD">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    
    <tr valign="top">
      <td align="right" bgcolor="#FFFFFF">&nbsp;</td>
      <td align="right" bgcolor="#FFFFFF">Fax : </td>
      <td bgcolor="#FFFFFF"><?php echo $row_edit['fax']; ?></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF"><div align="right">Nama Referensi : </div></td>
      <td bgcolor="#FFFFFF"><?php echo $row_edit['nama1']; ?></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    <tr valign="top">
      <td align="right" bgcolor="#FFFFFF">&nbsp;</td>
      <td align="right" bgcolor="#FFFFFF">email : </td>
      <td bgcolor="#FFFFFF"><?php echo $row_edit['email']; ?>
          <input name="id2" type="hidden" id="id2" value="<?php echo $row_edit['id']; ?>" />
        Format : abc@xx.com </td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF"><div align="right">Alamat : </div></td>
      <td rowspan="2" bgcolor="#FFFFFF"><?php echo $row_edit['alamat1']; ?>
          <input name="id4" type="hidden" id="id4" value="<?php echo $row_edit['id']; ?>" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    <tr valign="top">
      <td align="right" bgcolor="#FFFFFF">&nbsp;</td>
      <td align="left" bgcolor="#FFFFFF"><div align="right">NPWP : </div></td>
      <td bgcolor="#FFFFFF"><?php echo $row_edit['npwp']; ?></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    <tr valign="top">
      <td align="left" bgcolor="#FFFFFF">&nbsp;</td>
      <td align="left" bgcolor="#FFFFFF"><div align="right">No. KTP*  :</div></td>
      <td bgcolor="#FFFFFF"><?php echo $row_edit['ktp']; ?></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF"><div align="right">Telp/HP .: </div></td>
      <td bgcolor="#FFFFFF"><?php echo $row_edit['tlp1']; ?></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    <tr valign="top">
      <td align="left" bgcolor="#FFFFFF">&nbsp;</td>
      <td align="left" bgcolor="#FFFFFF"><div align="right">Masa berlaku KTP* : </div></td>
      <td bgcolor="#FFFFFF"><?php echo $row_edit['masaberlakuktp']; ?></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    
    
    <tr>
      <td align="left" bgcolor="#FFFFFF">&nbsp;</td>
      <td align="left" bgcolor="#FFFFFF"></td>
      <td bgcolor="#FFFFFF"><label>

        </label>
          <label>
          <input type="button" name="Button" value="Tutup" onClick="javascript:window.close();">
        </label></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
  </table>
</form>
</body>
</html>